package main

import (
	"app/common"
	"app/config"
	"app/route"
	"flag"
	"github.com/zeromicro/go-zero/core/conf"
)

// var ServiceCtx *common.ServiceContext

var configFile = flag.String("f", "etc/app.yaml", "the config file")

func main() {
	flag.Parse()
	var c config.Config
	conf.MustLoad(*configFile, &c)
	// 初始化全局资源
	common.InitGlobal(c)

	r := route.Routes()
	// 注入中间件

	err := r.Run(":8081")
	if err != nil {
		return
	}
}
